/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ActionForm;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

/**
 *
 * @author dennis
 */
public class mobPedidoActionForm extends org.apache.struts.action.ActionForm {
    
    private String name;
    private String cmbDia;
    private String cmbMes;
    private String cmbAnio;
    private String cmbFormaPago;

    public String getCmbAnio() {
        return cmbAnio;
    }

    public void setCmbAnio(String cmbAnio) {
        this.cmbAnio = cmbAnio;
    }

    public String getCmbDia() {
        return cmbDia;
    }

    public void setCmbDia(String cmbDia) {
        this.cmbDia = cmbDia;
    }

    public String getCmbFormaPago() {
        return cmbFormaPago;
    }

    public void setCmbFormaPago(String cmbFormaPago) {
        this.cmbFormaPago = cmbFormaPago;
    }

    public String getCmbMes() {
        return cmbMes;
    }

    public void setCmbMes(String cmbMes) {
        this.cmbMes = cmbMes;
    }
    private int number;

    public mobPedidoActionForm(HttpServletRequest request) {
        cmbDia = request.getParameter("cmbDia").toUpperCase();
        cmbMes = request.getParameter("cmbMes").toUpperCase();
        cmbAnio = request.getParameter("cmbAnio").toUpperCase();
        cmbFormaPago = request.getParameter("cmbFormaPago");

       
    }
    /**
     * @return
     */
    public String getName() {
        return name;
    }

    /**
     * @param string
     */
    public void setName(String string) {
        name = string;
    }

    /**
     * @return
     */
    public int getNumber() {
        return number;
    }

    /**
     * @param i
     */
    public void setNumber(int i) {
        number = i;
    }

    /**
     *
     */
    public mobPedidoActionForm() {
        super();
        // TODO Auto-generated constructor stub
    }

    /**
     * This is the action called from the Struts framework.
     * @param mapping The ActionMapping used to select this instance.
     * @param request The HTTP Request we are processing.
     * @return
     */
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        ActionErrors errors = new ActionErrors();
        if (getName() == null || getName().length() < 1) {
            errors.add("name", new ActionMessage("error.name.required"));
            // TODO: add 'error.name.required' key to your resources
        }
        return errors;
    }
}
